<?php require '../includes/security.php'; ?>

<?php require_once('../Connections/connection.php'); ?>
<?php
mysql_select_db($database_setroma, $setroma);
$query_oggetti = "SELECT * FROM stanze";
$oggetti = mysql_query($query_oggetti, $setroma) or die(mysql_error());
$row = mysql_fetch_assoc($oggetti);
$totalRows = mysql_num_rows($oggetti);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Elenco Stanze</title>
<head>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../thickbox.js"></script>
<script type="text/javascript" src="../scripts/BubbleTooltips.js"></script>
<link rel='stylesheet' type='text/css' href='../styles/style.css' />
<link rel='stylesheet' type='text/css' href='../thickbox.css' />

<?php include '../includes/jsscripts.php'; ?>

</head>


<body>
<h1>SiteRoom - Amministrazione Stanze </h1>
<br>
<table  class="sofT">
<tr>
	<td colspan="7" class="helpHed">Elenco Stanze</td>
	<td class="helpHed"><a href="inserisci.php">Nuovo</a></td>
</tr>
  <tr>
    <td class="helpHed">ID</td>
    <td class="helpHed">Nome</td>
    <td class="helpHed">Immagine</td>
	<td class="helpHed"></td>
	<td class="helpHed"></td>
	<td class="helpHed"></td>
	<td class="helpHed"></td>
	<td class="helpHed"></td>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row['id_stanza']; ?></td>
      <td><?php echo $row['Titolo']; ?></td>
      <td><a href="../userfiles/rooms/<?php echo $row['Path']; ?>" class="thickbox"><img src="../userfiles/rooms/<?php echo $row['Path']; ?>" height=50px /></a></td>
	  <td><a href="modifica.php?id=<?php echo $row['id_stanza']; ?>">Modifica</a></td>
	  <td><a href="elimina.php?id=<?php echo $row['id_stanza']; ?>" onclick="return confirm('Sei sicuro di vole cancellare l\'oggetto?\nUna volta rimosso non sara\' possibile recuperarlo!')">Elimina</a></td>
	  <td><a href="../oggetti/index.php?id_stanza=<?php echo $row['id_stanza']; ?>">Oggetti</a></td>
	<td><a href="javascript:popUp('../admin.php?id_stanza=<?php echo $row['id_stanza']; ?>');">Organizza</a><br></td>
	<td><a href="javascript:popUp('../index.php?id_stanza=<?php echo $row['id_stanza']; ?>');">Visualizza</a><br></td>
    </tr>
    <?php } while ($row = mysql_fetch_assoc($oggetti)); ?>
</table>
<?php include '../includes/admin_footer.php'; ?>
</body>
</html>
<?php
mysql_free_result($oggetti);
?>
